"""
时间戳
time常用来计算代码执行的速度
"""
import time

print(time.time())
# time.sleep(3)
print(time.time())

# 将时间戳转换为字符串
print(time.ctime(time.time()))
# 时间戳转换为元组
t = time.localtime(time.time())
print(t)
print(t.tm_mday)

# 将元组转换为时间戳
t = time.localtime(time.time())
print(time.mktime(t))
# 将时间戳转为字符串
s = time.strftime('%Y-%m-%d %H:%M:%S')
print(s)
# 将字符串转为固定的元组格式
t = time.strptime('2020-11-20', '%Y-%m-%d')
print(t)

"""
重点：
time()
time.sleep()
time.strftime(格式)
"""
